const express = require('express')
// 创建路由对象
const router = express.Router()

const indexRouter = require('../router_handle/index')

router.get('/coupons', indexRouter.allCoupons)  //获取所有优惠券

router.put('/coupons/:couponCode/use', indexRouter.usedCoupons) //更新优惠券状态

router.post('/form', indexRouter.form)  //填写姓名电话

router.get('/getuserinfo/:openid', indexRouter.getuserinfo) //获取姓名电话

router.post('/createOrders', indexRouter.createOrders)//创建新订单

router.get('/getorderId/:room_id/:user_id', indexRouter.getorderId)//获取订单id

router.post('/create-order', indexRouter.payOrder)//生成订单编号

router.post('/payment', indexRouter.payment)//插入支付订单表数据

router.post('/usedOrder', indexRouter.usedOrder)// 更新订单表的支付状态和订单状态

router.post('/usedPayment/:payment_status/:order_id', indexRouter.usedPayment)// 更新订单支付表的支付状态

router.get('/orderMessage/:order_id', indexRouter.orderMessage)//获取订单表所有信息

router.get('/paymentMessage/:order_id', indexRouter.paymentMessage)//获取订单支付表所有信息

router.get('/roomMessage/:room_id', indexRouter.roomMessage)

router.post('/updataInfo', indexRouter.updataInfo)

router.post('/allorderMessage', indexRouter.allorderMessage)

router.post('/Instereviews', indexRouter.Instereviews)




// 将路由对象共享出去s
module.exports = router